﻿using Autofac.Extensions.DependencyInjection;

namespace Forum
{
    public static class IHostBuilderExtensions
    {
        /// <summary>
        /// 使用autofac
        /// </summary>
        /// <param name="hostBuilder"></param>
        /// <returns></returns>
        public static IHostBuilder UseAutofac(this IHostBuilder hostBuilder)
        {
            return hostBuilder.UseServiceProviderFactory(new AutofacServiceProviderFactory());
        }
    }
}
